Commands for all device types MODE SELECT(10) command MODE SENSE(10) command
SCSI-2

8.2.10 MODE SENSE(6) command

The MODE SENSE(6) command (see table 54) provides a means for a target to report parameters to the initiator. It is a complementary command to the MODE SELECT(6) command.

Table 54 - MODE SENSE(6) command

===============================================================================
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=============================================================================|
| 0   |                           Operation code (1Ah)                        |
|-----------------------------------------------------------------------------|
| 1   | Logical unit number      |Reserved|   DBD  |         Reserved         |
|-----------------------------------------------------------------------------|
| 2   |       PC        |                   Page code                         |
|-----------------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----------------------------------------------------------------------------|
| 4   |                           Allocation length                           |
|-----------------------------------------------------------------------------|
| 5   |                           Control                                     |
===============================================================================
A disable block descriptors (DBD) bit of zero indicates that the target may return zero or more block descriptors in the returned MODE SENSE data (see 8.3.3), at the target's discretion. A DBD bit of one specifies that the target shall not return any block descriptors in the returned MODE SENSE data.

The page control (PC) field defines the type of mode parameter values to be returned in the mode pages. The page control field is defined in table 55.

Table 55 - Page control field

============================================
| Code  |  Type of parameter  | Subclause  |
|------------------------------------------|
|  00b  |  Current values     |  8.2.10.1  |
|  01b  |  Changeable values  |  8.2.10.2  |
|  10b  |  Default values     |  8.2.10.3  |
|  11b  |  Saved values       |  8.2.10.4  |
============================================
( The page control field only affects the mode parameters within the mode pages, however the PS bit, page code and page length fields should return current values since they have no meaning when used with other types. The mode parameter header and mode parameter block descriptor should return current values. )

The page code specifies which mode page(s) to return. Mode page code usage is defined in table 56.

Table 56 - Mode page code usage for all devices

===============================================================================
|  Page code  |  Description                                     |  Subclause |
|-----------------------------------------------------------------------------|
|     00h     |  Vendor-specific (does not require page format)  |            |
|  01h - 1Fh  |  See specific device-types                       |            |
|  20h - 3Eh  |  Vendor-specific (page format required)          |            |
|     3Fh     |  Return all mode pages                           |            |
===============================================================================
An initiator may request any one or all of the supported mode pages from a target. If an initiator issues a MODE SENSE command with a page code value not implemented by the target, the target shall return CHECK CONDITION status and shall set the sense key to ILLEGAL REQUEST and the additional sense code to INVALID FIELD IN CDB.

A page code of 3Fh indicates that all mode pages implemented by the target shall be returned to the initiator. If the mode parameter list exceeds 256 bytes for a MODE SENSE(6) command or 65 536 bytes for a MODE SENSE(10) command, the target shall return CHECK CONDITION status and the sense key shall be set to ILLEGAL REQUEST and the additional sense code set to INVALID FIELD IN CDB.

Mode page 00h, if implemented, shall be returned after all other mode pages.

( Mode pages should be returned in ascending page code order except for mode page 00h. ) ( If the PC field and the page code field are both set to zero the target should return a mode parameter header and block descriptor (if applicable). This provides for compatibility with existing SCSI-1 initiators. )

The mode parameter list for all device types for MODE SELECT and MODE SENSE is defined in 8.3.3. Parts of the mode parameter list are specifically defined for each device type. See subclause three of each peripheral device type for further information.

8.2.10.1 Current values

A PC field value of 0h requests that the target return the current values of the mode parameters. The current values returned are:

  1. the current values of the mode parameters established by last successful MODE SELECT command;
  2. the saved values of the mode parameters if a MODE SELECT command has not successfully completed since the last power-on, hard RESET condition, or BUS DEVICE RESET message;
  3. the default values of the mode parameters, if saved values, are not available or not supported.

8.2.10.2 Changeable values

A PC field value of 1h requests that the target return a mask denoting those mode parameters that are changeable. In the mask, the fields of the mode parameters that are changeable shall be set to all one bits and the fields of the mode parameters that are non-changeable (i.e. defined by the target) shall be set to all zero bits.

( An attempt to change a non-changeable mode parameter (via MODE SELECT) results in an error condition (see 8.2.8). ) ( The initiator should issue a MODE SENSE command with the PC field set to 1h and the page code field set to 3Fh to determine which mode pages are supported, which mode parameters within the mode pages are changeable, and the supported length of each mode page prior to issuing any MODE SELECT commands. )

8.2.10.3 Default values

A PC field value of 2h requests that the target return the default values of the mode parameters. Parameters not supported by the target shall be set to zero. Default values are accessible even if the device is not ready.

8.2.10.4 Saved values

A PC field value of 3h requests that the target return the saved values of the mode parameters. Implementation of saved page parameters is optional. Mode parameters not supported by the target shall be set to zero. If saved values are not implemented, the command shall be terminated with CHECK CONDITION status, the sense key set to ILLEGAL REQUEST and the additional sense code set to SAVING PARAMETERS NOT SUPPORTED.

( The method of saving parameters is vendor-specific. The parameters are preserved in such a manner that they are retained when the target is powered down. All savable pages can be considered saved when a MODE SELECT command issued with the SP bit set to one has returned a GOOD status or after the successful completion of a FORMAT UNIT command. )

8.2.10.5 Initial responses

After a power-up condition or hard reset condition, the target shall respond in the following manner:

  1. If default values are requested, report the default values.
  2. If saved values are requested, report valid restored mode parameters, or restore the mode parameters and report them. If the saved values of the mode parameters are not able to be accessed from the non- volatile vendor-specific location, terminate the command with CHECK CONDITION status and set the sense key set to NOT READY. If saved parameters are not implemented respond as defined in 8.2.10.4.
  3. If current values are requested and the current values of the mode parameters have not been sent by the initiator (via a MODE SELECT command), the target may return either the default or saved values, as defined above. If current values have been sent, the current values shall be reported.